package com.yanq.liancar.base;

import android.content.Context;
import android.os.Bundle;
import com.yanq.liancar.activity.base.BaseToolbarActivity;
import com.yanq.liancar.net.HttpUtil;
import com.yanq.liancar.util.ACache;

public abstract class BaseActivity extends BaseToolbarActivity {

    protected Context mContext;
    protected HttpUtil mHttpUtil;
    protected ACache mCache;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getContentResId());
        mContext = this;
        mCache = ACache.get(mContext);
        mHttpUtil = HttpUtil.getInstance();
        init();
    }

    public abstract int getContentResId();
    public abstract void init();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mContext = null;
    }
}